#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;
class Equation {
private:
	double a, b, c;
public:
	Equation() {
		a = 1.0;
		b = 1.0;
		c = 0;
	}
	Equation(double a_, double b_, double c_) {
		a = a_;
		b = b_;
		c = c_;
	}
	void set(double a1,double b1,double c1) {
		a = a1;
		b = b1;
		c = c1;
	}
	void getRoot() {
		double num = pow(b, 2) - 4 * a * c;
		if (num > 0) {
			double n1 = (-b + pow(num, 0.5)) / (2 * a);
			double n2 = (-b - pow(num, 0.5)) / (2 * a);
			cout << "x1=";
			cout << fixed << setprecision(2) << n1;
			cout << " x2=" << fixed << setprecision(2) << n2 << endl;
		}
        else if(num == 0) {
			double n = -b / (2 * a);
			cout << "x1=x2=" << fixed << setprecision(2) << n << endl;
		}
		else {
			num *= -1;
			double n = -b  / (2 * a);
			cout << "x1=" << fixed << setprecision(2) << n << '+';
			cout << fixed << setprecision(2) << pow(num, 0.5)/(2*a) << 'i';
			cout << " x2=" << fixed << setprecision(2) << n << '-';
			cout << fixed << setprecision(2) << pow(num, 0.5)/(2*a) << 'i' << endl;
		}
	}
};
int main()
{
	int t;
	cin >> t;
	for (int i = 0; i < t; i++) {
		double a, b, c;
		cin >> a >> b >> c;
		Equation m(a, b, c);
		m.getRoot();
	}
	return 0;
}